package com.engine4cloud.tdf.supervision.feign;

import com.engine4cloud.tdf.common.core.constant.SecurityConstants;
import com.engine4cloud.tdf.common.core.constant.ServiceNameConstants;
import com.engine4cloud.tdf.common.core.util.R;
import com.engine4cloud.tdf.common.data.web.response.PageInfo;
import com.engine4cloud.tdf.common.data.web.response.Params;
import com.engine4cloud.tdf.supervision.dto.DcpgEvaluateDTO;
import com.engine4cloud.tdf.supervision.dto.query.DcpgInvestigationQueryDTO;
import com.engine4cloud.tdf.supervision.dto.result.DcpgInvestigationResultDTO;
import jakarta.validation.Valid;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;


/**
 * 调查评估-委托
 *
 * @author sh
 * @date 2024-08-02 15:07:07
 */
@FeignClient(contextId = "RemoteDcpgInvestigationService", value = ServiceNameConstants.SUPERVISION_SERVER)
public interface RemoteDcpgInvestigationService {

    /**
     * 分页查询
     *
     * @param page 分页对象
     * @param dto  调查评估-委托-请求对象
     * @return R<PageInfo < DcpgInvestigationResultDTO>>
     */
    @GetMapping("/inner/investigation/page")
    R<PageInfo<DcpgInvestigationResultDTO>> getInvestigationPage(@RequestParam("page") Params page, @Valid @RequestParam("dto") DcpgInvestigationQueryDTO dto,
                                                                 @RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 通过id查询调查评-委托信息
     *
     * @param id id
     * @return R
     */
    @GetMapping("/inner/investigation/{id}")
    R<DcpgInvestigationResultDTO> getById(@PathVariable("id") Long id, @RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 调查评估-结果意见（所填写）
     *
     * @param dto 调查评估-结果意见（所填写）
     * @return R 权限：和编辑是一个权限
     */
    @PutMapping("/inner/investigation/evaluate")
    R<Boolean> evaluate(@RequestBody DcpgEvaluateDTO dto, @RequestHeader(SecurityConstants.FROM) String from);
}
